package cn.mesmile.design.factory.abstractfactory;

import cn.hutool.core.util.StrUtil;
import cn.mesmile.design.factory.abstractfactory.ali.AliOrderFactory;
import cn.mesmile.design.factory.abstractfactory.wechat.WechatOrderFactory;

/**
 * @author zb
 * @date 2020/11/15 13:02
 * @Description: 工厂创造器
 */
public class FactoryProducer {



    public static OrderFactory getFactory (String type) {

        if (StrUtil.isEmpty(type)) {
            return null;
        }
        if (type.equalsIgnoreCase("WECHAT_PAY")) {
            return new WechatOrderFactory();
        } else {
            return new AliOrderFactory();
        }

    }


}
